#pragma once
///////////////////////////////////////////////////////////////////////////////
// Project: Hoyo Client Game
//
// hy_stddef.h
// Created: 2012-8-1
// Author: Like Cheng
///////////////////////////////////////////////////////////////////////////////


#ifndef __HY_STDDEF_H__
#define __HY_STDDEF_H__


#define HY_VERSION_STR   "0.01"
#define HY_VERSION		0x000001	


#define HY_COCOS2DX		0x00020
#define HY_WIN32		0x00032
#define HY_LINUX		0x00240
#define HY_MAC			0x00106
#define HY_BADA			0x00006
#define HY_QNX			0x00007
#define HY_QT_WIN		0x00732

#define HY_OS			HY_QT_WIN


#define HY_DEBUG		1
#define HY_STATE		HY_DEBUG

typedef unsigned char	uint8;
typedef unsigned char	uchar;
typedef char			schar;
typedef	signed char		sint8;
typedef unsigned short	uint16;
typedef signed short	sint16;
typedef unsigned int	uint;
//typedef signed int		sint;
typedef int				sint;
typedef unsigned long	uint64;
typedef signed long		sint64;
typedef unsigned int	uint32;

typedef float			float32;
typedef double			float64;

typedef char			ubool;

#define	hy_true			1
#define hy_false		0


#define DEL_POINTER( x )	\
	if( x )	\
{		\
	delete x;\
	x = NULL;\
}

#define DEL_ARRAY_POINTER( x )	\
	if( x )	\
{	\
	delete[] (x);	\
	(x) = NULL;		\
}

#define HY_SAFE_FREE( x )		\
	if( x )	\
{				\
	free( x );	\
	x = NULL;	\
}


#ifdef __cplusplus
#define NS_HY_BEGIN                     namespace hy_tools {
#define NS_HY_END                       }
#define USING_NS_HY                     using namespace hy_tools
#define NS_HY_EXT_BEGIN                 namespace hy_tools { namespace extension { 
#define NS_HY_EXT_END                   }} 
#define USING_NS_HY_EXT                 using namespace hy_tools::extension
#define HY_NS							hy_tools

//#define NS_HY_GAMEDATA_BEGIN			
//#define NS_HY_GAMEDATA_END				
//#define USING_NS_HY_GAMEDATA            
//#define HY_GAMEDATA(a)					a

#define NS_HY_GAMEDATA_BEGIN			namespace hy_gamedata {
#define NS_HY_GAMEDATA_END				}
#define USING_NS_HY_GAMEDATA            using namespace hy_gamedata
#define HY_GAMEDATA(a)					hy_gamedata::a

#else

#define NS_HY_BEGIN                     
#define NS_HY_END
#define USING_NS_HY                     
#define NS_HY_EXT_BEGIN                 
#define NS_HY_EXT_END    
#define USING_NS_HY_EXT
#define HY_NS

#define NS_HY_GAMEDATA_BEGIN			
#define NS_HY_GAMEDATA_END				
#define USING_NS_HY_GAMEDATA	

#endif 

#if defined( USEDLL )
	#if defined( USEDLL_O )
	#define HY_DLL		__declspec(dllexport)
	#endif
	#if defined( USEDLL_I )
	#define HY_DLL		__declspec(dllimport)
	#endif
#else
	#define	HY_DLL
#endif

#include <assert.h>

#define HY_ASSERT(cond)		assert(cond)
#define HY_UNUSED_PARAM(unusedparam)	(void)unusedparam


#ifndef NULL
#ifdef __cplusplus
#define NULL	0
#else
#define NULL	((void *)0)
#endif
#endif


#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <memory.h>
#include <time.h>
#include <math.h>
#include <assert.h>
#include <algorithm> 
#include <string.h>
#include <fstream>
#include <sstream>

#include <math.h>
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <list>
#include <iterator> 


typedef std::set< sint >						int_set;
typedef std::vector< std::string >				string_vec;
typedef std::vector< sint >						int_vec;
typedef std::map< sint, std::string >			string_map;
typedef std::vector< float >					float_vec;


#define IS_RUN_JSON
#define IS_RUN_LOG
//#define IS_RUN_MD5
//#define IS_RUN_BASE64
//#define IS_RUN_ZIP
//#define IS_RUN_COCOS2DX
//#define IS_RUN_COCOS2DX_EXT

#if HY_OS == HY_WIN32
#include <Windows.h>
#endif

using namespace std;

class hy_object
{
};

#endif
